# -*- coding: utf-8 -*-
# @Time : 2024/3/7 11:13
# @Author : ZH
# @File : 2575.py
# @Software: PyCharm
class Solution(object):
    def divisibilityArray(self, word, m):
        """
        :type word: str
        :type m: int
        :rtype: List[int]
        """
        cur = 0
        l = []
        for i in range(len(word)):
            cur = (cur * 10 + int(word[i])) % m
            l.append(0 if cur == 0 else 1)
        return l


if __name__ == '__main__':
    so = Solution()
    z = so.divisibilityArray(word="998244353", m=3)
    print(z)
